<?php
namespace app\user\validate\user;

use think\Validate;

/**
 * 会员验证
 */
class Vip extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名'    =>    ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'vip_id'    => 'require|integer',
        'payway'    => 'require|in:alipay,wxpay,lcnpay',
        'from'      => 'require|in:android,ios,pc,miniprogram,h5',
    ];

    protected $field = [
        'vip_id'    => '会员类型',
        'payway'    => '支付方式',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名'    =>    '错误信息'
     *
     * @var array
     */
    protected $message = [
        'payway.in' => '支付方式错误',

    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'buy'       => ['vip_id'],
    ];


}
